Imports System.Collections


Public Interface IListener
    ReadOnly Property Listening() As Boolean
    Sub Listen(ByVal message As String)
    Sub Listen(ByVal message As String, ByVal formatter As IFormatter)
End Interface


Public Class ListenerCollection
    Inherits CollectionBase

    Default Public Property Item(ByVal index As Integer) As IListener
        Get
            Return (CType(List(index), IListener))
        End Get
        Set(ByVal Value As IListener)
            List(index) = Value
        End Set
    End Property

    Public Function Add(ByVal value As IListener) As Integer
        Return List.Add(value)
    End Function

    Public Sub Remove(ByVal value As IListener)
        List.Remove(value)
    End Sub

    Public Function ItemCount() As Integer
        Return list.Count
    End Function

End Class
